<template>
  <div class="awards">
    <h3>{{ title }}</h3>
    <el-table :data="awards" stripe>
      <el-table-column prop="name" label="奖项名称" width="180" />
      <el-table-column prop="issuingOrg" label="颁发机构" width="180" />
      <el-table-column prop="date" label="获奖时间" />
      <el-table-column prop="description" label="奖项描述" />
      <el-table-column label="证明文件">
        <template #default="{ row }">
          <el-link
              v-if="row.certificate"
              :href="row.certificate"
              target="_blank"
              type="primary"
          >
            查看证书
          </el-link>
          <span v-else>无</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup lang="ts">
defineProps<{
  awards: Resume['awards']
  title: string
}>()
</script>